<!-- 显示留言表：php100_message_list.php -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<img src="http://localhost/image/second.jpg" height="437" width="996" /><br>
<?php

 include("php100_message_conn.php");
error_reporting(7);
 include("php100_message_head.php");
 $pagesize=5;
$url=$_SERVER["REQUEST_URI"];
$url=parse_url($url);
$url=$url[path];

$numq=mysql_query("SELECT * FROM `message`");
$num = mysql_num_rows($numq);

if($_GET[page]){
$pageval=$_GET[page];
$page=($pageval-1)*$pagesize;
$page.=',';
}
if($num > $pagesize){
 if($pageval<=1)$pageval=1;
echo "共 $num 条".
		" <a href=$url?page=".($pageval-1).">上一页</a> <a href=$url?page=".($pageval+1).">下一页</a>";
} 
  $SQL="SELECT * FROM `message` limit $page $pagesize";
  $query=mysql_query($SQL);
  while($row=mysql_fetch_array($query)){
?>

<table width=500 border="0" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
  <tr bgcolor="#eff3ff">
  <td>标题：<?=$row[title]?> 用户：<?=$row[user]?></td>
  </tr>
  <tr bgColor="#ffffff">
  <td>内容：<?
 echo htmtocode($row[content]);
   ?></td>
  </tr>
</table>
<?
  }
?>
